package com.fcl.blog.mapper;

import com.fcl.blog.po.Blog;
import com.fcl.blog.po.BlogTags;
import com.fcl.blog.vo.BlogVo;
import com.fcl.blog.vo.SearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author 付
 * @Date 2023/10/24 11:57
 * @Version 1.0
 * @description 博客的mapper接口，负责博客的CURUD
 * @since 1.0
 */
@Mapper
public interface BlogMapper {
    List<Blog> selectListBlog();
    List<Blog> selectListAdminBlog();
    int insertBlog(@Param("blog") Blog blog);
    int insertBlogTags(@Param("blogTags") BlogTags blogTags);

    List<Blog> searchBlog(@Param("title") String title,@Param("typeId") String typeId);
    List<Blog> searchAdminBlog(@Param("title") String title,@Param("typeId") String typeId);

    int deleteById(@Param("id") Long id);

    //获取所有blog的个数
    Long blogCount();
    Long blogAdminCount();

    List<Blog> selectNewRecommend();

    List<Blog> selectByTypeId(@Param("id") Long id);
}
